<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CryptoAuthLib: swi_bitbang_samd21.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CryptoAuthLib
   </div>
   <div id="projectbrief">Microchip CryptoAuthentication Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00554_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">swi_bitbang_samd21.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a00554.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#ifndef SWI_BITBANG_SAMD21_H_</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define SWI_BITBANG_SAMD21_H_</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00173.html">atca_status.h</a>&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;delay.h&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="a00554.html#af9d9d027ce20f528edea144203141714">   35</a></span>&#160;<span class="preprocessor">#define MAX_SWI_BUSES   36      </span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor"></span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="a01145.html">   38</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;{</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="a01145.html#a7d0970077e95bd9d8ed8aac6b3e115ee">   40</a></span>&#160;    uint32_t <a class="code" href="a00536.html#afd6d53ef6b697533839248b40bc97861">pin_sda</a>[<a class="code" href="a00554.html#af9d9d027ce20f528edea144203141714">MAX_SWI_BUSES</a>];</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;} <a class="code" href="a01145.html">SWIBuses</a>;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keyword">extern</span> <a class="code" href="a01145.html">SWIBuses</a> <a class="code" href="a00554.html#a8ba5507b651724b4cdc74106a16b025c">swi_buses_default</a>;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="a00554.html#ad884cf7d66d88b38180369a791a9824b">   55</a></span>&#160;<span class="preprocessor">#define BIT_DELAY_1L        delay_us(3)</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">#define BIT_DELAY_1H        delay_us(3)</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="a00554.html#a2ced4699fc4ab5162dbb9453edecb32e">   61</a></span>&#160;<span class="preprocessor">#define BIT_DELAY_5        delay_us(26)    // considering pin set delay</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="a00554.html#abd0d20a34060650b8a2895c17f842f44">   65</a></span>&#160;<span class="preprocessor">#define BIT_DELAY_7        delay_us(34)    // considering pin set delay</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="a00554.html#a60ba93807a2c0ea2ce1432245f3f7da0">   69</a></span>&#160;<span class="preprocessor">#define RX_TX_DELAY         delay_us(65)</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="a00554.html#ab10604796b42fb6b8eed23fc88ebd47f">   74</a></span>&#160;<span class="preprocessor">#define START_PULSE_TIME_OUT    (600)</span></div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="a00554.html#ad935b86cd295ba61924231e29033c55b">   81</a></span>&#160;<span class="preprocessor">#define ZERO_PULSE_TIME_OUT     (40)</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00554.html#a076fc28889d32327dd3372538106da92">swi_set_pin</a>(uint8_t <span class="keywordtype">id</span>);</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00554.html#ad78929b51b34df503a37b4961577d5ce">swi_enable</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00554.html#af016fffdce9f520096de8631e6692707">swi_disable</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00554.html#a79bc8f2b72647fce853274cf8474b41e">swi_set_signal_pin</a>(uint8_t is_high);</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00554.html#ada6b4629603758b67820568677ab2a19">swi_send_wake_token</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00554.html#af0382e26c4d83b0762b39d12c772dd2e">swi_send_bytes</a>(uint8_t count, uint8_t *buffer);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00554.html#a1c5ab22e67923ee54eef0e33b227be0b">swi_send_byte</a>(uint8_t <span class="keywordtype">byte</span>);</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<a class="code" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> <a class="code" href="a00554.html#afa009f7d683cb82293570a27d1f8ee10">swi_receive_bytes</a>(uint8_t count, uint8_t *buffer);</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* SWI_BITBANG_SAMD21_H_ */</span><span class="preprocessor"></span></div><div class="ttc" id="a00554_html_a1c5ab22e67923ee54eef0e33b227be0b"><div class="ttname"><a href="a00554.html#a1c5ab22e67923ee54eef0e33b227be0b">swi_send_byte</a></div><div class="ttdeci">void swi_send_byte(uint8_t byte)</div><div class="ttdoc">Send one byte.</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:123</div></div>
<div class="ttc" id="a00173_html_a22bd6643f31f1d75dc3e7ea939f468cd"><div class="ttname"><a href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a></div><div class="ttdeci">ATCA_STATUS</div><div class="ttdef"><b>Definition:</b> atca_status.h:41</div></div>
<div class="ttc" id="a00554_html_ada6b4629603758b67820568677ab2a19"><div class="ttname"><a href="a00554.html#ada6b4629603758b67820568677ab2a19">swi_send_wake_token</a></div><div class="ttdeci">void swi_send_wake_token(void)</div><div class="ttdoc">Send a Wake Token.</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:78</div></div>
<div class="ttc" id="a00554_html_a076fc28889d32327dd3372538106da92"><div class="ttname"><a href="a00554.html#a076fc28889d32327dd3372538106da92">swi_set_pin</a></div><div class="ttdeci">void swi_set_pin(uint8_t id)</div><div class="ttdoc">Set SWI signal pin. Other functions will use this pin.</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:43</div></div>
<div class="ttc" id="a00554_html_ad78929b51b34df503a37b4961577d5ce"><div class="ttname"><a href="a00554.html#ad78929b51b34df503a37b4961577d5ce">swi_enable</a></div><div class="ttdeci">void swi_enable(void)</div><div class="ttdoc">Configure GPIO pin for SWI signal as output.</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:48</div></div>
<div class="ttc" id="a00554_html_af016fffdce9f520096de8631e6692707"><div class="ttname"><a href="a00554.html#af016fffdce9f520096de8631e6692707">swi_disable</a></div><div class="ttdeci">void swi_disable(void)</div><div class="ttdoc">Configure GPIO pin for SWI signal as input.</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:57</div></div>
<div class="ttc" id="a00554_html_a79bc8f2b72647fce853274cf8474b41e"><div class="ttname"><a href="a00554.html#a79bc8f2b72647fce853274cf8474b41e">swi_set_signal_pin</a></div><div class="ttdeci">void swi_set_signal_pin(uint8_t is_high)</div><div class="ttdoc">Set signal pin Low or High.</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:66</div></div>
<div class="ttc" id="a00536_html_afd6d53ef6b697533839248b40bc97861"><div class="ttname"><a href="a00536.html#afd6d53ef6b697533839248b40bc97861">pin_sda</a></div><div class="ttdeci">uint8_t pin_sda</div><div class="ttdef"><b>Definition:</b> i2c_bitbang_samd21.c:40</div></div>
<div class="ttc" id="a00554_html_afa009f7d683cb82293570a27d1f8ee10"><div class="ttname"><a href="a00554.html#afa009f7d683cb82293570a27d1f8ee10">swi_receive_bytes</a></div><div class="ttdeci">ATCA_STATUS swi_receive_bytes(uint8_t count, uint8_t *buffer)</div><div class="ttdoc">Receive a number of bytes.This function should not be called directly ,instead should use hal_swi_rec...</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:128</div></div>
<div class="ttc" id="a00554_html_af9d9d027ce20f528edea144203141714"><div class="ttname"><a href="a00554.html#af9d9d027ce20f528edea144203141714">MAX_SWI_BUSES</a></div><div class="ttdeci">#define MAX_SWI_BUSES</div><div class="ttdoc">SAMD21 xplainned pro has 36 free GPIO pins available.</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.h:35</div></div>
<div class="ttc" id="a01145_html"><div class="ttname"><a href="a01145.html">SWIBuses</a></div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.h:38</div></div>
<div class="ttc" id="a00554_html_a8ba5507b651724b4cdc74106a16b025c"><div class="ttname"><a href="a00554.html#a8ba5507b651724b4cdc74106a16b025c">swi_buses_default</a></div><div class="ttdeci">SWIBuses swi_buses_default</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:36</div></div>
<div class="ttc" id="a00554_html_af0382e26c4d83b0762b39d12c772dd2e"><div class="ttname"><a href="a00554.html#af0382e26c4d83b0762b39d12c772dd2e">swi_send_bytes</a></div><div class="ttdeci">void swi_send_bytes(uint8_t count, uint8_t *buffer)</div><div class="ttdoc">Send a number of bytes.This function should not be called directly ,instead should use hal_swi_send()...</div><div class="ttdef"><b>Definition:</b> swi_bitbang_samd21.c:85</div></div>
<div class="ttc" id="a00173_html"><div class="ttname"><a href="a00173.html">atca_status.h</a></div><div class="ttdoc">Microchip Crypto Auth status codes.</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_e870e4dac26de7990352b1cb7547818f.html">hal</a></li><li class="navelem"><a class="el" href="a00554.html">swi_bitbang_samd21.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
